package com.neutech.springframework.mapper.impl;

import com.neutech.springframework.entity.User;
import com.neutech.springframework.mapper.IUserMapper;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class UserMapperImpl extends SqlSessionDaoSupport implements IUserMapper {
    @Autowired/*set注入*/
    @Override
    public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
        super.setSqlSessionFactory(sqlSessionFactory);
    }

    @Override
    public List<User> selectAll() {
        return this.getSqlSession().getMapper(IUserMapper.class).selectAll();
    }
}


































